<?php
/**
 * Created by PhpStorm.
 * User: mac
 * Date: 2018/4/27
 * Time: 上午10:59
 */
require ('./CreteProcess.php');

$handler = opendir('./address');
$files = array();
while (($filename = readdir($handler)) !== false) {//务必使用!==，防止目录下出现类似文件名“0”等情况
    if ($filename != "." && $filename != "..") {
        $files[] = $filename ;
    }
}
closedir($handler);

$redis = new Redis();
$redis->connect('127.0.0.1', 6379);
foreach ($files as $file) {
    $file = explode(".", $file)[0];
    $redis->lPush('array', $file);
}

$process = new CreteProcess();
print_r($process);